#ifndef GIFBLOCK_H
#define GIFBLOCK_H

#include "winggif.h"
#include <QIODevice>
#include <QObject>

namespace WingGif {

enum class ExtensionLabel {
  GifExtension = 0x21,
  GifCommentExtension = 0xFE,
  GifPlainTextExtension = 0x01,
  GifApplicationExtension = 0xFF,
  GifGraphicControlExtension = 0xF9,
};

enum BlokID {
  ExtensionIntroducer = 0x21,
  ImageSeparator = 0x2C,
  TrailerByte = 0x3B
};

class GifExtension;

enum class GifBlockKind { Control, GraphicRendering, SpecialPurpose, Other };

class WINGEXPORT GifBlock : public QObject {
  Q_OBJECT
public:
  explicit GifBlock(QObject *parent = nullptr);
  virtual bool read(QIODevice *stream,
                    QList<GifExtension *> controlExtensions) = 0;
  virtual GifBlockKind kind() = 0;
};

} // namespace WingGif

#endif // GIFBLOCK_H
